<script>
</script>
<div class='tabs'>
	<div class="uc_title m_10 tabs_menu">
		<label class="current node"><span>修改手机号</span></label>
	</div>
</div>
<table class="form_table" width="100%" cellpadding="0" cellspacing="0" id="app">
	<col width="120px" />
	<col />
	<tr>
		<th>新手机号：</th>
		<td><input id='newpwd' v-model="phoneNumber" class="normal" type="text" /><label></label></td>
	</tr>
	<tr>
		<th></th>
		<td><label class="btn"><input type="button" @click="updatephoneNumber" id="updatepwd"
									  value="保存" /></label> <label class="btn">
			<input type="button" id="cancel" @click="cleanphoneNumber" value="清空" /></label></td>
	</tr>
</table>
<script type="text/javascript">
	new Vue({
		el:"#app",
		data:{
			phoneNumber:""
		},
		methods:{
			updatephoneNumber:function () {
				console.log(this.phoneNumber);
				axios.post("/user/updatePhoneNumberByUid?phoneNumber="+this.phoneNumber)
						.then(res => {
							console.info(res);
							if (res.data.code ==200 ){
								layer.msg('恭喜你修改成功!', {icon: 1});
							}else if (res.data.code ==305){
								layer.msg('您输入的手机号格式错误哦!', {icon: 5});
							}else if (res.data.code ==6){
								layer.msg('您输入的手机号已经被使用!', {icon: 4});
							}
							else{
								layer.msg('系统异常!', {icon: 5});
							}
						});
			},
			cleanphoneNumber:function(){
				this.phoneNumber = "";
			}
		},
	});
</script>